<?php 
use_helper('javascript');
use_helper('ciPager');
?>
	<div class="cTitle"><?php echo $cTitle; ?> :: 
	<?php echo link_to1('产品列表','product/index');?>  |  
	<?php echo link_to1('添加新产品','product/create');?>  |  
	<?php echo link_to1('首页推荐','product/index?flag=1');?>  |  	
	<?php echo link_to1('产品搜索','product/search');?>	
	</div>
	<div id="content">
	<br />总计<span class="red"><?php echo $total; ?></span>条记录<br />
    <table class="cList" width="99%" cellspacing="1" cellpadding="2" >
    <tr>
		<td width="6%" class="cFirst">编号
		<?php echo link_to1(image_tag('sort_desc.gif',array('border'=>0)),'product/index?orderby=id');?>
		</td>
		<td width="15%" class="cFirst">名称</td>
		<td width="10%" class="cFirst">货号</td>
		<td width="10%" class="cFirst">规格</td>
		<td width="10%" class="cFirst">产地</td>
		<td width="10%" class="cFirst">报价</td>
		<td width="10%" class="cFirst">卖价</td>
		<td width="10%" class="cFirst">类别
		<?php echo link_to1(image_tag('sort_desc.gif',array('border'=>0)),'product/index?orderby=class');?>
		</td>
		<td width="20%" class="cFirst">操作</td>
    </tr>
	<?php if($categories):?>
	<?php foreach($categories as $cate):?>
	<tr>
		<td class="cSecond"><?php echo $cate->getId();?></td>
		<td class="cSecond"><?php echo $cate->getTitle();?></td>
		<td class="cSecond"><?php echo $cate->getLotno();?></td>
		<td class="cSecond"><?php echo $cate->getSpecs();?></td>
		<td class="cSecond"><?php echo $cate->getCity();?></td>
		<td class="cSecond"><?php echo $cate->getFprice();?></td>
		<td class="cSecond"><?php echo $cate->getSprice();?></td>
		<td class="cSecond"><?php echo $cate->getProductCategory()->getTitle();?></td>
		<td class="cSecond">
		<?php echo link_to1('编辑','product/edit?id='.$cate->getId());?> | 
		<?php echo link_to1('删除','product/delete?id='.$cate->getId(),array('onclick'=>"return confirm('您确定吗?');"));?> | 
		<?php
		echo link_to1($cate->getFlag()?'取消推荐':'推荐','product/recommend?id='.$cate->getId());
		?> 
		</td>
    </tr>
	<?php endforeach;?>
	<?php else:?>
	<tr>
		<td colspan="5" class="error">
		暂无产品，请<?php echo link_to1('添加','product/create');?>
		</td>
    </tr>
	<?php endif;?>
    </table>
	<div id="cListTarget" class="cListTarget">
		<?php echo pagination($pager,'product/index?orderby='.$order_by);?>	
	</div>
	</div>
